package com.leoncom.sms_silencer;

import com.leoncom.sms_silencer.util.SilencerTask;
import com.leoncom.sms_silencer.util.SmsLogger;
import com.leoncom.sms_silencer.util.TaskDataSource;
import com.leoncom.sms_silencer.util.TaskScheduler;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class BooterReceiver extends BroadcastReceiver {
	public BooterReceiver() {
	}

	@Override
	public void onReceive(Context context, Intent intent) {
		TaskDataSource taskds = new TaskDataSource(context);
		taskds.open();
		SilencerTask curTask = taskds.getTask();
		if(curTask != null) {
			TaskScheduler.scheduleAlarm(context, curTask);
			SmsLogger.append("Boot Alarm Start");
		}
	}
}
